package com.jinzecloud.reportapproval.controller;

import java.util.Arrays;
import java.util.Map;

//import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.jinzecloud.reportapproval.bean.Experimentalfieldsurveyrecord;
import com.jinzecloud.reportapproval.service.ExperimentalfieldsurveyrecordService;
import com.jinzecloud.reportapproval.utils.PageUtils;
import com.jinzecloud.reportapproval.utils.R;



/**
 * 表5 试验田调查记录表
 *
 * @author æ­å°
 * @email 1971240051@qq.com
 * @date 2024-12-04 15:46:42
 */
@RestController
@RequestMapping("reportapproval/experimentalfieldsurveyrecord")
public class ExperimentalfieldsurveyrecordController {
    @Autowired
    private ExperimentalfieldsurveyrecordService experimentalfieldsurveyrecordService;

    /**
     * 列表
     */
    @RequestMapping("/list")
    //@RequiresPermissions("reportapproval:experimentalfieldsurveyrecord:list")
    public R list(@RequestParam Map<String, Object> params){
        PageUtils page = experimentalfieldsurveyrecordService.queryPage(params);

        return R.ok().put("page", page);
    }


    /**
     * 信息
     */
    @RequestMapping("/info/{recordid}")
    //@RequiresPermissions("reportapproval:experimentalfieldsurveyrecord:info")
    public R info(@PathVariable("recordid") Integer recordid){
		Experimentalfieldsurveyrecord experimentalfieldsurveyrecord = experimentalfieldsurveyrecordService.getById(recordid);

        return R.ok().put("experimentalfieldsurveyrecord", experimentalfieldsurveyrecord);
    }

    /**
     * 保存
     */
    @RequestMapping("/save")
    //@RequiresPermissions("reportapproval:experimentalfieldsurveyrecord:save")
    public R save(@RequestBody Experimentalfieldsurveyrecord experimentalfieldsurveyrecord){
		experimentalfieldsurveyrecordService.save(experimentalfieldsurveyrecord);

        return R.ok();
    }

    /**
     * 修改
     */
    @RequestMapping("/update")
    //@RequiresPermissions("reportapproval:experimentalfieldsurveyrecord:update")
    public R update(@RequestBody Experimentalfieldsurveyrecord experimentalfieldsurveyrecord){
		experimentalfieldsurveyrecordService.updateById(experimentalfieldsurveyrecord);

        return R.ok();
    }

    /**
     * 删除
     */
    @RequestMapping("/delete")
    //@RequiresPermissions("reportapproval:experimentalfieldsurveyrecord:delete")
    public R delete(@RequestBody Integer[] recordids){
		experimentalfieldsurveyrecordService.removeByIds(Arrays.asList(recordids));

        return R.ok();
    }

}
